#ifndef LEGENDEDITDIALOG_H
#define LEGENDEDITDIALOG_H

#include <QDialog>
#include <QModelIndex>

class LegendModel;
class AbstractPlot2D;
class GreekAlphabetDialog;

namespace Ui {
    class LegendEditDialog;
}

class LegendEditDialog : public QDialog {
    Q_OBJECT
public:
    LegendEditDialog(AbstractPlot2D *plotter, QWidget *parent = 0);
    ~LegendEditDialog();

private slots:
    void apply();
    void changeCurve(const QModelIndex &index);
    void changeFont();
    void changeText(const QString &text);

    void addSupIndex();
    void addSubIndex();
    void addBold();
    void addItalic();
    void addUnderline();
    void showGreekAlphabetDlg();
    void addGreekSymbl(const QString &str);

protected:
    void changeEvent(QEvent *e);

private:
    Ui::LegendEditDialog *ui;
    AbstractPlot2D *_plotter;
    GreekAlphabetDialog *greekAlphabetDlg;
    LegendModel *model;
    QFont _font;
    void init();
};

#endif // LEGENDEDITDIALOG_H
